#!/bin/bash

# postinst script for system-trusted
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
        chown root:bin $BASEDIR/usr/share/man/man1
	chown root:bin $BASEDIR/usr/share/man/man7
	chown root:bin $BASEDIR/usr/share/man/man8
	chown root:bin $BASEDIR/lib
	chown root:bin $BASEDIR/lib/svc
	chown root:bin $BASEDIR/lib/svc/method
	chown root:bin $BASEDIR/usr/bin
	chown root:bin $BASEDIR/usr/demo
	chown root:bin $BASEDIR/usr/demo/tsol
	chown root:bin $BASEDIR/usr/lib
	chown root:bin $BASEDIR/usr/lib/brand
	chown root:bin $BASEDIR/usr/lib/help
	chown root:bin $BASEDIR/usr/lib/help/auths
	chown root:bin $BASEDIR/usr/lib/help/auths/locale
	chown root:bin $BASEDIR/usr/lib/help/auths/locale/C
	chown root:bin $BASEDIR/usr/lib/help/profiles
	chown root:bin $BASEDIR/usr/lib/help/profiles/locale
	chown root:bin $BASEDIR/usr/lib/help/profiles/locale/C
	chown root:bin $BASEDIR/usr/lib/zones
	chown root:bin $BASEDIR/usr/sbin
	chown root:bin $BASEDIR/usr/share/man
	chown root:sys $BASEDIR/lib/svc/manifest
	chown root:sys $BASEDIR/lib/svc/manifest/system
	chown root:sys $BASEDIR/sbin
	chown root:sys $BASEDIR/usr
	chown root:sys $BASEDIR/usr/lib/brand/labeled
	chmod 0444 "$BASEDIR/usr/lib/brand/labeled/config.xml"
	chown root:bin "$BASEDIR/usr/lib/brand/labeled/config.xml"
	chmod 0444 "$BASEDIR/usr/lib/brand/labeled/platform.xml"
	chown root:bin "$BASEDIR/usr/lib/brand/labeled/platform.xml"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/FileChown.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/FileChown.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/FileHeader.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/FileHeader.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/FileOwner.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/FileOwner.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/LabelFileDowngrade.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/LabelFileDowngrade.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/LabelFileUpgrade.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/LabelFileUpgrade.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/LabelHeader.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/LabelHeader.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/LabelPrint.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/LabelPrint.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/LabelRange.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/LabelRange.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/LabelServer.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/LabelServer.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintAdmin.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintAdmin.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintCancel.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintCancel.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintHeader.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintHeader.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintList.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintList.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintNoBanner.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintNoBanner.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintPs.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintPs.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/PrintUnlabeled.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/PrintUnlabeled.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/TNDaemon.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/TNDaemon.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/TNctl.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/TNctl.html"
	chmod 0444 "$BASEDIR/usr/lib/help/auths/locale/C/ValueTND.html"
	chown root:bin "$BASEDIR/usr/lib/help/auths/locale/C/ValueTND.html"
	chmod 0444 "$BASEDIR/usr/lib/help/profiles/locale/C/RtInfoSec.html"
	chown root:bin "$BASEDIR/usr/lib/help/profiles/locale/C/RtInfoSec.html"
	chmod 0444 "$BASEDIR/usr/lib/help/profiles/locale/C/RtObjectLabelMngmnt.html"
	chown root:bin "$BASEDIR/usr/lib/help/profiles/locale/C/RtObjectLabelMngmnt.html"
	chmod 0444 "$BASEDIR/usr/lib/help/profiles/locale/C/RtOutsideAccred.html"
	chown root:bin "$BASEDIR/usr/lib/help/profiles/locale/C/RtOutsideAccred.html"
	chmod 0555 "$BASEDIR/lib/svc/method/svc-tsol-zones"
	chown root:bin "$BASEDIR/lib/svc/method/svc-tsol-zones"
	chmod 0555 "$BASEDIR/usr/bin/getlabel"
	chown root:bin "$BASEDIR/usr/bin/getlabel"
	chmod 0555 "$BASEDIR/usr/bin/getzonepath"
	chown root:bin "$BASEDIR/usr/bin/getzonepath"
	chmod 0555 "$BASEDIR/usr/bin/plabel"
	chown root:bin "$BASEDIR/usr/bin/plabel"
	chmod 0555 "$BASEDIR/usr/bin/setlabel"
	chown root:bin "$BASEDIR/usr/bin/setlabel"
	chmod 0555 "$BASEDIR/usr/bin/updatehome"
	chown root:bin "$BASEDIR/usr/bin/updatehome"
	chmod 0555 "$BASEDIR/usr/demo/tsol/clonebylabel.sh"
	chown root:bin "$BASEDIR/usr/demo/tsol/clonebylabel.sh"
	chmod 0555 "$BASEDIR/usr/demo/tsol/getmounts.sh"
	chown root:bin "$BASEDIR/usr/demo/tsol/getmounts.sh"
	chmod 0555 "$BASEDIR/usr/demo/tsol/runinzone.ksh"
	chown root:bin "$BASEDIR/usr/demo/tsol/runinzone.ksh"
	chmod 0555 "$BASEDIR/usr/demo/tsol/runwlabel.ksh"
	chown root:bin "$BASEDIR/usr/demo/tsol/runwlabel.ksh"
	chmod 0555 "$BASEDIR/usr/demo/tsol/waitforzone.ksh"
	chown root:bin "$BASEDIR/usr/demo/tsol/waitforzone.ksh"
	chmod 0555 "$BASEDIR/usr/lib/labeld"
	chown root:bin "$BASEDIR/usr/lib/labeld"
	chmod 0555 "$BASEDIR/usr/sbin/add_allocatable"
	chown root:bin "$BASEDIR/usr/sbin/add_allocatable"
	chmod 0444 "$BASEDIR/lib/svc/manifest/system/tsol-zones.xml"
	chown root:sys "$BASEDIR/lib/svc/manifest/system/tsol-zones.xml"
	chmod 0555 "$BASEDIR/sbin/tnctl"
	chown root:sys "$BASEDIR/sbin/tnctl"
	chmod 0555 "$BASEDIR/usr/lib/lslabels"
	chown root:sys "$BASEDIR/usr/lib/lslabels"
	chmod 0555 "$BASEDIR/usr/lib/zones/zoneshare"
	chown root:sys "$BASEDIR/usr/lib/zones/zoneshare"
	chmod 0555 "$BASEDIR/usr/lib/zones/zoneunshare"
	chown root:sys "$BASEDIR/usr/lib/zones/zoneunshare"
	chmod 0555 "$BASEDIR/usr/sbin/atohexlabel"
	chown root:sys "$BASEDIR/usr/sbin/atohexlabel"
	chmod 0555 "$BASEDIR/usr/sbin/chk_encodings"
	chown root:sys "$BASEDIR/usr/sbin/chk_encodings"
	chmod 0555 "$BASEDIR/usr/sbin/hextoalabel"
	chown root:sys "$BASEDIR/usr/sbin/hextoalabel"
	chmod 0555 "$BASEDIR/usr/sbin/tnchkdb"
	chown root:sys "$BASEDIR/usr/sbin/tnchkdb"
	chmod 0555 "$BASEDIR/usr/sbin/tnd"
	chown root:sys "$BASEDIR/usr/sbin/tnd"
	chmod 0555 "$BASEDIR/usr/sbin/tninfo"
	chown root:sys "$BASEDIR/usr/sbin/tninfo"
	chmod 0555 "$BASEDIR/usr/sbin/txzonemgr"
	chown root:sys "$BASEDIR/usr/sbin/txzonemgr"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

